<!doctype html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>{$title}</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <link href="/js/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="/css/partner.css">
    <script type="text/javascript" src="/js/jquery-2.1.4.min.js"></script>
    <script type="text/javascript" src="/js/bootstrap/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="/js/layermobile/layer.js"></script>

    <script>
        var id = '';
        $(function(){
            localStorage.setItem("mark","{$token}");
            //进入页面加载数据
            $.ajax({
                url : "{$rooturl}/Partner/userPartner?token="+localStorage.getItem('mark'),
                type:"post",
                beforeSend:function(){
                    layer.open({type: 2});
                },
                success:function(data){
                    //展示数据
                   $('.user-name').html("<label><strong>"+data.data.user.username+"</strong></label>");
                    $('.user-img img').attr('src',data.data.user.img);
                    $('#t_com').text('￥'+data.data.com.t_com);
                    $('#a_com').text('￥'+data.data.com.a_com);
                    $('#s_com').text('￥'+data.data.com.s_com);
                    $(".partner_wei").attr('href',"{$rooturl}/Partner/showQrcode/?uid="+data.data.userid);
                    $('#corecount').text(data.data.part.corecount);
                    $('#coremoney').text(data.data.part.coremoney);
                    $('#heightcount').text(data.data.part.heightcount);
                    $("#heightmoney").text(data.data.part.heightmoney);
                    $("#lowcount").text(data.data.part.lowcount);
                    $("#lowmoney").text(data.data.part.lowmoney);
                    layer.closeAll();
                }
            });

            $('#back').bind('click', function () {
                localStorage.clear();
                window.history.go(-1);
            });

            $("#my-money-button").bind('click', function () {
                layer.open({
                    content: '提现功能开发中，敬请期待!',
                    time: 2 //2秒后自动关闭
                })
            });

        });
    </script>
</head>
<body>
    <div class="container-fluid">
        <div class="row">
            <nav class="navbar navbar-default">
                <div class="container-fluid">
                    <div class="navbar-header">
                        <a class="navbar-brand" id="back" href="javascript:void(0);">
                            <span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span>
                        </a>
                    </div>
                </div>
            </nav>

            <!-- 显示图片和和用户名 -->
            <div class="col-md-12">
                <div class="use-con">
                    <div class="user-div">
                        <a class="withdrawals" href="jacascript:void(0)" id="my-money-button">提现</a>
                        <div class="user-img">
                            <img src="" alt="图像加载中...">
                        </div>
                        <div class="user-partner">
                            <span class="user-name"></span>
                        </div>
                    </div>
                    <br/>
                    <strong>
                        <div>
                            <div class="user_bot clear">
                                <span class="user_a">总佣金<br><label id="t_com">￥0</label></span>
                                <span class="user_a">已提取<br><label id="a_com">￥0</label></span>
                                <span style="background:none;" class="user_a">剩余佣金<br><label id="s_com">￥0</label></span>
                            </div>
                            <div class="clear"></div>
                        </div>

                        <div class="partner_top clear">
                            <a class="partner_wei">邀请好友赚佣金</a>
                            <!--<a class="partner_yao" id="my-share" href="jacascript:void(0)">邀请好友赚佣金</a>-->
                        </div>

                        <div class="partner_con clear">
                            <table width="100%" cellspacing="0" cellpadding="0" border="0">
                                <tbody>
                                <tr>
                                    <td>等级</td>
                                    <td>人数</td>
                                    <td>累计佣金</td>
                                </tr>
                                <tr>
                                    <td>核心合伙人</td>
                                    <td id="corecount">0</td>
                                    <td id="coremoney">0</td>
                                </tr>
                                <tr>
                                    <td>高级合伙人</td>
                                    <td id="heightcount">0</td>
                                    <td id="heightmoney">0</td>
                                </tr>
                                <tr>
                                    <td>普通合伙人</td>
                                    <td id="lowcount">0</td>
                                    <td id="lowmoney">0</td>
                                </tr>
                                <tr>
                                    <td colspan="3">当天佣金在第二天进行结算</td>
                                </tr>
                                </tbody>
                            </table>
                            <div class="clear"></div>
                        </div>
                    </strong>
                </div>
            </div>

        </div>
    </div>
</body>
</html>